import Vue from 'vue'
import Router from 'vue-router'
import index from './views/index.vue'

Vue.use(Router)
//导出默认新路由器
export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting 路线级别代码分隔
    //   // this generates a separate chunk (about.[hash].js) for this route 这将为该路由生成一个单独的块
    //   // which is lazy-loaded when the route is visited.当访问路由时，哪个是延迟加载的
    //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    // },
    //自己
    // {
    //   path: '/last',
    //   name: 'last',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.

    //   //component:组件
    //   component: () => import(/* webpackChunkName: "about" */ './views/Last.vue')
    // }
  ]
})
